﻿
// 功能模块grid展示
Module_PhotoList = function (id) {
    var Module_PhotoStore=null;
    var url = "/manager/Module_Photo/List/"+id;
    var sm = Ext.create('Ext.selection.CheckboxModel');

    //grid 填充
    Ext.define('Module_PhotoGridModel'+id, {
        extend: 'Ext.data.Model',
        fields: [
            { name: "Id", type:"string"},
            { name: "ChannelId", type:"string"},
            { name: "Title", type:"string"},
            { name: "TColor", type:"string"},
            { name: "Summary", type:"string"},
            { name: "Enabled", type:"string"}
            ]
    });

    //grid获取 json数组
    Module_PhotoStore = Ext.create('Ext.data.Store', {
        pageSize: CMN.pageSize,
        model: 'Module_PhotoGridModel' + id,
        buffered: false,  //是否动态加载
        proxy: {
            actionMethods: 'post',
            type: 'ajax',
            url: url,
            reader: {
                type: 'json',
                root: 'root',
                totalProperty: 'totalPorperty'
            }
        },
        sorters: [{
            property: 'Id',
            direction: 'DESC'
}]
        });

        //分页设置
        var pagingBar = Ext.create('Ext.PagingToolbar', {
            displayInfo: true, emptyMsg: "没有数据显示", displayMsg: "显示从{0}条数据到{1}条数据，共{2}条数据",
            store: Module_PhotoStore,
            pageSize: CMN.pageSize,
            //显示右下角信息
            prevText: "上一页",
            nextText: "下一页",
            refreshText: "刷新",
            lastText: "最后页",
            firstText: "第一页",
            beforePageText: "当前页",
            afterPageText: "共{0}页"
        });

        //删除选中行信息
       var DeleteModule_PhotoFn = function() {
            var row = Ext.getCmp("Module_PhotoGrid" + id).getSelectionModel().getSelection();
            if (row.length == 0) {
                Ext.Msg.alert("提示信息", "请您至少选择一个!");
            }
            else if (row.length > 1) {
                var idList = "";
                for (var i = 0; i < row.length; i++) {
                    if (i == 0) {
                        idList = row[0].data.Id;
                    }
                    else {
                        idList = idList +"_" + row[i].data.Id;
                    }
                }
                //Ext.Msg.alert("提示信息", "对不起只能选择一个!");
                Ext.Msg.confirm("提 示!", "您确定要删除" + idList + "吗?", function(btn) {
                    if (btn == "yes") {
                        Ext.Ajax.request({
                            url: "/manager/Module_Photo/DeleteList/" + idList,
                            method: "get",
                            success: function(d) {
                                //成功后
                                var action = Ext.JSON.decode(d.responseText);
                                //alert(action.success);
                                var flag = action.success;
                                if (flag == "true") {
                                    Module_PhotoStore.loadPage(1);
                                    Ext.MessageBox.alert("恭喜", "删除成功!");
                                }
                                else {
                                    var message = action.result.message;
                                    if (message) {
                                        Ext.MessageBox.alert("删除失败!", message);
                                    }
                                    else {
                                        Ext.MessageBox.alert("提示!", "删除失败!");
                                    }
                                }
                            },
                            failure: function(form, action) {
                                Ext.MessageBox.alert("提示!", "修改失败!");
                            }
                        })
                    }
                    else {

                    }
                })
            }
            else if (row.length == 1) {
                Ext.Msg.confirm("提 示!", "您确定要删除" + row[0].data.Id + "吗?", function(btn) {
                    if (btn == "yes") {
                        Ext.Ajax.request({
                            url: "/manager/Module_Photo/Delete/" + row[0].data.Id,
                            method: "POST",
                            success: function(d) {
                                //成功后
                                var action = Ext.JSON.decode(d.responseText);
                                //alert(action.success);
                                var flag = action.success;
                                if (flag == "true") {
                                    Module_PhotoStore.loadPage(1);
                                    Ext.MessageBox.alert("恭喜", "删除成功!");
                                }
                                else {
                                    var message = action.result.message;
                                    if (message) {
                                        Ext.MessageBox.alert("删除失败!", message);
                                    }
                                    else {
                                        Ext.MessageBox.alert("提示!", "删除失败!");
                                    }
                                }
                            },
                            failure: function(form, action) {
                                Ext.MessageBox.alert("提示!", "修改失败!");
                            }
                        })
                    }
                    else {

                    }
                })
            }
        }


        //修改选中行信息
       var EditModule_PhotoFn = function() {
            var row = Ext.getCmp("Module_PhotoGrid"+ id).getSelectionModel().getSelection();
            if (row.length == 0) {
                Ext.Msg.alert("提示信息", "您没有选中任何行!");
            }
            else if (row.length > 1) {
                Ext.Msg.alert("提示信息", "对不起只能选择一个!");
            } else if (row.length == 1) {
                EditModule_Photo(row[0].data.Id);
            }

        }

        //新增信息
       var SaveModule_PhotoFn = function() {
            InsertModule_Photo();
        }

        //grid配置
        var grid = Ext.create('Ext.grid.Panel', {
            id: "Module_PhotoGrid"+  id,
            renderTo: "Module_PhotoGrid"+  id,
            layout: "fit",
            alias: 'widget.methodPanel',
            columnLines: true,
            loadMask: true,
            frame: true,
            border: false,
            selModel: sm,   //选择框
            autoScroll: true,
            store: Module_PhotoStore,
            ds: Module_PhotoStore,
            sm: sm,
            columnLines: true,
            //cm: cm2,
            viewConfig: {
                stripeRows: true,
                trackOver: true,
                emptyText: '<div style="color:#999;margin:5px;">当前没有记录显示<div>'
            },
            stripeRows: true,
            listeners: {
                "itemdblclick": function(g, rowIndex, e) {
                    EditModule_PhotoFn();
                }
            },
            bbar: pagingBar,
            tbar: [            		 //工具条设置
            		 {
            		 text: "新增",
            		 tooltip: "新增",
            		 iconCls: "addicon",
            		 handler: SaveModule_PhotoFn
           }, "", "-", "", {
               text: "编辑",
               tooltip: "编辑",
               iconCls: "editicon",
               handler: EditModule_PhotoFn
           }, "", "-", "", {
               text: "删除",
               tooltip: "删除",
               iconCls: "deleteicon",
               handler: DeleteModule_PhotoFn
           }, "-"],
            columns: [
               Ext.create('Ext.grid.RowNumberer'),
                { header: "图片ID", dataIndex: "Id", width: 80, sortable: true },
                { header: "图片标题", dataIndex: "Title", width: 80, sortable: true },
                { header: "标题颜色", dataIndex: "TColor", width: 80, sortable: true },
                { header: "添加时间", dataIndex: "AddDate", width: 80, sortable: true },
                { header: "简介", dataIndex: "Summary", width: 80, sortable: true },
                { header: "是否启用", dataIndex: "Enabled", width: 1, renderer: function(value) { if (value == "1") { return "是"; } else { return "否"; } }, sortable: true },
                { header: "删除", dataIndex: "Id", renderer: function(value) { return "<a href='javascript:void(0);' title='删除' onclick='DeleteModule_PhotoFn()'class='deleteBtn' >&nbsp;&nbsp;&nbsp;</a>" }, width: 40 }    
            ]
        });
        Module_PhotoStore.loadPage(1);
       




        //新增图片
   var InsertModule_Photo = function() {
    var InsertModule_PhotoForm = Ext.create("Ext.form.Panel", {
        width: 360,
        height: 450,
       
        autoScroll: true, 
        layout: "anchor",
        defaultType: "textfield",
        labelWidth: 55,
        baseCls: "x-plain",
        defaults: { labelAlign: 'right', anchor: '90%', msgTarget: "side" },
        buttonAlign: "center",
        bodyStyle: "padding:0 0 0 0",
        items: [{
            name: "Title",
            fieldLabel: "<font color='red'>*</font>图片标题",
            allowBlank: false,
            blankText: "图片标题不能为空",
            regex: /^[\da-zA-Z]{1,150}$/,
            regexText: "请填写1～150个数字或字母"
        }, {
            name: "TColor",
            fieldLabel: "标题颜色",
            regex: /^[\da-zA-Z]{0,50}$/,
            regexText: "请填写0～50个数字或字母"
        }, {
            xtype:"datefield",
            name: "AddDate",
            fieldLabel: "<font color='red'>*</font>添加时间",
            allowBlank: false,
            blankText: "添加时间不能为空"
        }, {
            name: "Summary",

            fieldLabel: "<font color='red'>*</font>简介",
            allowBlank: false,
            blankText: "简介不能为空",
            regex: /^[\w]{1,1000}$/,
            regexText: "请填写1～1000"
         }, {
            name: "Editor",
            fieldLabel: "<font color='red'>*</font>编辑人员",
            allowBlank: false,
            blankText: "编辑人员不能为空",
            regex: /^[\da-zA-Z]{1,20}$/,
            regexText: "请填写1～20个数字或字母"
        }, {
            name: "Author",
            fieldLabel: "作者",
            regex: /^[\da-zA-Z]{0,30}$/,
            regexText: "请填写0～30个数字或字母"
        }, {
            name: "Tags",
            fieldLabel: "标签",
            regex: /^[\da-zA-Z]{0,60}$/,
            regexText: "请填写0～60个数字或字母"
        }, {
            name: "ViewNum",
            fieldLabel: "<font color='red'>*</font>查看数量",
            allowBlank: false,
            blankText: "查看数量不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "IsPass",
            fieldLabel: "是否审核",
            xtype: "combo",
            //传入后台真实值value field /value
            editable: false,
            anchor: '90%',
            value: 0,
            store: Ext.create('Ext.data.Store', {
                fields: ['show', 'value'],
                data: [
			        { "show": "是", "value": 1 },
			        { "show": "否", "value":0 }
			    ]
            }),
            queryMode: 'local',
            displayField: 'show',
            valueField: 'value'
        }, {
            name: "IsImg",
            fieldLabel: "是否图片",
            xtype: "combo",
            //传入后台真实值value field /value
            editable: false,
            anchor: '90%',
            value: 0,
            store: Ext.create('Ext.data.Store', {
                fields: ['show', 'value'],
                data: [
			        { "show": "是", "value": 1 },
			        { "show": "否", "value":0 }
			    ]
            }),
            queryMode: 'local',
            displayField: 'show',
            valueField: 'value'
        }, {
            name: "Img",
            fieldLabel: "<font color='red'>*</font>图片地址",
            allowBlank: false,
            blankText: "图片地址不能为空",
            regex: /^[\da-zA-Z]{1,150}$/,
            regexText: "请填写1～150个数字或字母"
        }, {
            name: "OrderNum",
            fieldLabel: "<font color='red'>*</font>排序数",
            allowBlank: false,
            blankText: "排序数不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "UserId",
            fieldLabel: "<font color='red'>*</font>添加用户ID",
            allowBlank: false,
            blankText: "添加用户ID不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "ReadGroup",
            fieldLabel: "<font color='red'>*</font>阅读权限",
            allowBlank: false,
            blankText: "阅读权限不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "SourceFrom",
            fieldLabel: "<font color='red'>*</font>来源",
            allowBlank: false,
            blankText: "来源不能为空",
            regex: /^[\da-zA-Z]{1,30}$/,
            regexText: "请填写1～30个数字或字母"
        }, {
            name: "PhotoUrl",

            fieldLabel: "<font color='red'>*</font>图片地址",
            allowBlank: false,
            blankText: "图片地址不能为空",
            regex: /^[\w]{1,1000}$/,
            regexText: "请填写1～1000个数字或字母"
         }, {
            name: "PageSize",
            fieldLabel: "<font color='red'>*</font>显示图片数量",
            allowBlank: false,
            blankText: "显示图片数量不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "ReadComment",
            fieldLabel: "阅读评论权限",
            regex: /^[\d]{1,10}$/,
            regexText: "请填写1～10个数字"
        }, {
            name: "WriteComment",
            fieldLabel: "评论权限",
            regex: /^[\d]{1,10}$/,
            regexText: "请填写1～10个数字"
        }, {
            name: "SupportNum",
            fieldLabel: "<font color='red'>*</font>支持数",
            allowBlank: false,
            blankText: "支持数不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "AgainstNum",
            fieldLabel: "<font color='red'>*</font>反对数量",
            allowBlank: false,
            blankText: "反对数量不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "Enabled",
            fieldLabel: "是否启用",
            xtype: "combo",
            //传入后台真实值value field /value
            emptyText: '请选择',
            triggerAction: 'query',
            hiddenName: "M_IsSystem",
            readOnly: true,
            mode: "local",
            displayField: "show",
            valueField: "value",
            triggerAction: "all",
            value: "0",
            store: new Ext.data.SimpleStore({
                fields: ["show", "value"],
                data: [["是", "1"], ["否", "0"]]
            })
        }
			]
    });


    var InsertModule_PhotoWin = Ext.create('Ext.window.Window', {
        title: "新增图片",
        width: 400,
        height: 450,
       
        layout: "fit",
        //不可以随意改变大小
        resizable: false,
        //是否可以拖动
        //draggable:false,
        defaultType: "textfield",
        collapsible: true, //允许缩放条
        closeAction: 'destroy',
        closable: true,
        //弹出模态窗体
        modal: 'true',
        buttonAlign: "center",
        bodyStyle: "padding:10px 0 0 15px",
        items: [InsertModule_PhotoForm],

        buttons: [{
            text: "保存信息",
            minWidth: 70,
            handler: function() {
                //alert(InsertModule_PhotoForm.getForm().isValid())
                if (InsertModule_PhotoForm.getForm().isValid()) {
                    //弹出效果 Ext.MessageBox.alert("asdf");
                    Ext.MessageBox.show
                                (
                                    {
                                        msg: '正在保存，请稍等...',
                                        progressText: 'Saving...',
                                        width: 300,
                                        wait: true,
                                        waitConfig: { interval: 200 },
                                        icon: 'download',
                                        animEl: 'saving'
                                    }
                                );
                    setTimeout(function() { }, 1000);
                    InsertModule_PhotoForm.form.submit({
                        url: "/manager/Module_Photo/Insert/"+  id,
                        method: "POST",
                        success: function(form, action) {
                            //成功后
                            Ext.MessageBox.hide();
                            var flag = action.result.success;
                            if (flag == "true") {
                                Module_PhotoStore.loadPage(1);
                                Ext.helper.msg("恭喜", "新增成功!");
                                InsertModule_PhotoWin.hide();
                            }
                            else {
                                var message = action.result.message;
                                if (message) {
                                    Ext.MessageBox.alert("新增失败!", message);
                                }
                                else {
                                    Ext.MessageBox.alert("提示!", "新增失败!");
                                    InsertModule_PhotoWin.hide();
                                }

                            }
                        },
                        failure: function(form, action) {
                            Ext.MessageBox.alert("提示!", "新增失败!");
                        }
                    });
                }
            }
        }, {
            text: "重置",
            minWidth: 70,
            qtip: "重置数据",
            handler: function() {
                //加载表单数据
                InsertModule_PhotoForm.getForm().reset();
            }
        }, {
            text: "取 消",
            minWidth: 70,
            handler: function() {
                InsertModule_PhotoWin.hide();
            }
}]
        });
            InsertModule_PhotoWin.show();
    }
       








       //编辑图片
var EditModule_Photo = function(id) {
    var EditModule_PhotoForm = Ext.create("Ext.form.Panel", {
        width: 360,
        height: 450,
        autoScroll: true, 
       
        layout: "anchor",
        defaultType: "textfield",
        labelWidth: 55,
        baseCls: "x-plain",
        defaults: { labelAlign: 'right', anchor: "90%", msgTarget: "side" },
        buttonAlign: "center",
        bodyStyle: "padding:0 0 0 0",
        items: [{
                       name: "Id",
            fieldLabel: "<font color='red'>*</font>图片ID",
            allowBlank: false,
            blankText: "图片ID不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "ChannelId",
            fieldLabel: "<font color='red'>*</font>频道ID",
            allowBlank: false,
            blankText: "频道ID不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "Path",
            fieldLabel: "<font color='red'>*</font>频道路径",
            allowBlank: false,
            blankText: "栏目ID不能为空",
            regex: /^[\d]{0,10}$/,
            hidden:true,
            regexText: "请填写0～10个数字"
        }, {
            name: "Title",
            fieldLabel: "<font color='red'>*</font>图片标题",
            allowBlank: false,
            blankText: "图片标题不能为空",
            regex: /^[\da-zA-Z]{1,150}$/,
            regexText: "请填写1～150个数字或字母"
        }, {
            name: "TColor",
            fieldLabel: "标题颜色",
            regex: /^[\da-zA-Z]{0,50}$/,
            regexText: "请填写0～50个数字或字母"
        }, {
            xtype:"datefield",
            name: "AddDate",
            fieldLabel: "<font color='red'>*</font>添加时间",
            allowBlank: false,
            format: 'Y-m-d H:i:s',
            blankText: "添加时间不能为空"
        }, {
            name: "Summary",

            fieldLabel: "<font color='red'>*</font>简介",
            allowBlank: false,
            blankText: "简介不能为空",
            regex: /^[\w]{1,1000}$/,
            regexText: "请填写1～1000个数字或字母"
         }, {
            name: "Editor",
            fieldLabel: "<font color='red'>*</font>编辑人员",
            allowBlank: false,
            blankText: "编辑人员不能为空",
            regex: /^[\da-zA-Z]{1,20}$/,
            regexText: "请填写1～20个数字或字母"
        }, {
            name: "Author",
            fieldLabel: "作者",
            regex: /^[\da-zA-Z]{0,30}$/,
            regexText: "请填写0～30个数字或字母"
        }, {
            name: "Tags",
            fieldLabel: "标签",
            regex: /^[\da-zA-Z]{0,60}$/,
            regexText: "请填写0～60个数字或字母"
        }, {
            name: "ViewNum",
            fieldLabel: "<font color='red'>*</font>查看数量",
            allowBlank: false,
            blankText: "查看数量不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "IsPass",
            fieldLabel: "是否审核",
            xtype: "combo",
            //传入后台真实值value field /value
            editable: false,
            anchor: '90%',
            value: 0,
            store: Ext.create('Ext.data.Store', {
                fields: ['show', 'value'],
                data: [
			        { "show": "是", "value": 1 },
			        { "show": "否", "value":0 }
			    ]
            }),
            queryMode: 'local',
            displayField: 'show',
            valueField: 'value'
        }, {
            name: "IsImg",
            fieldLabel: "是否图片",
            xtype: "combo",
            //传入后台真实值value field /value
            editable: false,
            anchor: '90%',
            value: 0,
            store: Ext.create('Ext.data.Store', {
                fields: ['show', 'value'],
                data: [
			        { "show": "是", "value": 1 },
			        { "show": "否", "value":0 }
			    ]
            }),
            queryMode: 'local',
            displayField: 'show',
            valueField: 'value'
        }, {
            name: "Img",
            fieldLabel: "<font color='red'>*</font>图片地址",
            allowBlank: false,
            blankText: "图片地址不能为空",
            regex: /^[\da-zA-Z]{1,150}$/,
            regexText: "请填写1～150个数字或字母"
        }, {
            name: "OrderNum",
            fieldLabel: "<font color='red'>*</font>排序数",
            allowBlank: false,
            blankText: "排序数不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "UserId",
            fieldLabel: "<font color='red'>*</font>添加用户ID",
            allowBlank: false,
            blankText: "添加用户ID不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "ReadGroup",
            fieldLabel: "<font color='red'>*</font>阅读权限",
            allowBlank: false,
            blankText: "阅读权限不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "SourceFrom",
            fieldLabel: "<font color='red'>*</font>来源",
            allowBlank: false,
            blankText: "来源不能为空",
            regex: /^[\da-zA-Z]{1,30}$/,
            regexText: "请填写1～30个数字或字母"
        }, {
            name: "PhotoUrl",

            fieldLabel: "<font color='red'>*</font>图片地址",
            allowBlank: false,
            blankText: "图片地址不能为空",
            regex: /^[\w]{1,1000}$/,
            regexText: "请填写1～1000个数字或字母"
         }, {
            name: "PageSize",
            fieldLabel: "<font color='red'>*</font>显示图片数量",
            allowBlank: false,
            blankText: "显示图片数量不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "ReadComment",
            fieldLabel: "阅读评论权限",
            regex: /^[\d]{1,10}$/,
            regexText: "请填写1～10个数字"
        }, {
            name: "WriteComment",
            fieldLabel: "评论权限",
            regex: /^[\d]{1,10}$/,
            regexText: "请填写1～10个数字"
        }, {
            name: "SupportNum",
            fieldLabel: "<font color='red'>*</font>支持数",
            allowBlank: false,
            blankText: "支持数不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "AgainstNum",
            fieldLabel: "<font color='red'>*</font>反对数量",
            allowBlank: false,
            blankText: "反对数量不能为空",
            regex: /^[\d]{0,10}$/,
            regexText: "请填写0～10个数字"
        }, {
            name: "Enabled",
            fieldLabel: "是否启用",
            xtype: "combo",
            //传入后台真实值value field /value
            emptyText: '请选择',
            triggerAction: 'query',
            hiddenName: "M_IsSystem",
            readOnly: true,
            mode: "local",
            displayField: "show",
            valueField: "value",
            triggerAction: "all",
            value: "0",
            store: new Ext.data.SimpleStore({
                fields: ["show", "value"],
                data: [["是", "1"], ["否", "0"]]
            })
        }
			]
    });

    var EditModule_PhotoWin = new Ext.Window({
        title: "修改图片",
        width: 400,
        height: 450,
       
        layout: "fit",
        //iconCls: "addicon",
        //不可以随意改变大小
        resizable: false,
        //是否可以拖动
        //draggable:false,
        defaultType: "textfield",
        //labelWidth: 100,
        collapsible: true, //允许缩放条
        closeAction: 'destroy',
        closable: true,
        //弹出模态窗体
        modal: 'true',
        buttonAlign: "center",
        bodyStyle: "padding:10px 0 0 15px",
        items: [EditModule_PhotoForm],
        listeners: {
            "show": function() {
                if (id && id != "") {
                    //加载表单数据
                    EditModule_PhotoForm.form.load(
                                {
                                    url: "/manager/Module_Photo/Look/" + id,
                                    method: "get",
                                    success: function(form, action) {

                                    },
                                    failure: function(form, action) {
                                        Ext.Msg.alert("提示信息", "对不起加载数据失败!请联系管理员");
                                    }
                                }
                    );
                }
            }
        },
        buttons: [{
            text: "保存信息",
            minWidth: 70,
            handler: function() {
                //alert(EditModule_PhotoForm.getForm().isValid())
                if (EditModule_PhotoForm.getForm().isValid()) {
                    //弹出效果 Ext.MessageBox.alert("asdf");
                    Ext.MessageBox.show
                                (
                                    {
                                        msg: '正在保存，请稍等...',
                                        progressText: 'Saving...',
                                        width: 300,
                                        wait: true,
                                        waitConfig: { interval: 200 },
                                        icon: 'download',
                                        animEl: 'saving'
                                    }
                                );
                    setTimeout(function() { }, 1000);
                    EditModule_PhotoForm.form.submit({
                        url: "/manager/Module_Photo/Update/" + id,
                        method: "POST",
                        success: function(form, action) {
                            //成功后
                            Ext.MessageBox.hide();
                            var flag = action.result.success;
                            if (flag == "true") {
                                Module_PhotoStore.loadPage(1);
                               Ext.helper.msg("恭喜", "修改成功!");
                                EditModule_PhotoWin.hide();
                            }
                            else {
                                var message = action.result.message;
                                if (message) {
                                    Ext.MessageBox.alert("修改失败!", message);
                                }
                                else {
                                    Ext.MessageBox.alert("提示!", "修改失败!");
                                    EditModule_PhotoWin.hide();
                                }

                            }
                        },
                        failure: function(form, action) {
                            Ext.MessageBox.alert("提示!", "修改失败!");
                            EditModule_PhotoWin.hide();
                        }
                    });
                }
            }
        }, {
            text: "重置",
            minWidth: 70,
            qtip: "重置数据",
            handler: function() {
                //加载表单数据
                EditModule_PhotoForm.getForm().reset();
                EditModule_PhotoForm.form.load(
                                {
                                    url: "/manager/Module_Photo/Look/" + id,
                                    method: "get",
                                    success: function(form, action) {
                                    },
                                    failure: function(form, action) {
                                        //Ext.Msg.alert("提示信息","对不起加载数据失败!请联系管理员");
                                    }
                                }
                    );
            }
        }, {
            text: "取 消",
            minWidth: 70,
            handler: function() {
                EditModule_PhotoWin.hide();
            }

}]

        });

        EditModule_PhotoWin.show();
    }



    }
